package control;

import java.io.IOException;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Circle;

public class MyServlet extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String str1 = req.getParameter("radius");
		int tmp1 = Integer.parseInt(str1);
		Circle circle = new Circle();
		circle.setRadius(tmp1);
		double area = circle.getArea();
		ServletContext application = this.getServletContext();
		application.setAttribute("area", area);
		System.out.println(area);
		resp.sendRedirect("result.jsp");
		
	}
}
